<template>
  <div>
    
    <div class="waitCir">
        <div class="waitCir2">
        </div> 
        <div class="donghua">
                <div class="pacman">
                  <div></div>
                  <div></div>
                  <div></div>
                  <div></div>
                  <div></div>
                </div>
            </div>
         <div class="tongzhi">
              <div class="waitTitle">正在通知驻场人员请耐心等候……</div>
              <div class="tongzhifont">已通知 <span class="num">{{num}}</span>人</div>
              <el-button @click="cancel" type="warning">取消抢单</el-button>
              <div class="waitTime">已等候{{miao}}秒</div>
         </div>   
    </div>  
    
  </div>
</template>

<script>
const queryString = require("querystring");
import UserAddress from "components/address";
import { ScondDay } from "utils/formData";
import { FileChange } from "utils/formData";
export default {
  data() {
    return {
      num: this.$route.query.num,
      miao:1
    };
  },
  mounted() {
    this.getMiao();
  },
  methods: {
    getMiao(){
      let that=this;
      setInterval(function(){
      that.miao=that.miao+1;
      that.axios
        .get("/productOrder/" + that.$route.query.mainId)
        .then(res => {
          if (res.data.code === 200) {
             if(res.data.data.groundPersonId!=null){
                 this.$router.push({
                  path: "orderMain",
                  query: {
                    id: that.$route.query.mainId,
                     stateValue: "已派发",
                    childStateValue: "未转单",
                  }
                });
                return;
             }
          }
        })
        .catch(err => {
          console.log(err);
        });


      }, 1000);
    },
    cancel(){
      this.$router.back(-1)
    }
  }
};
</script>

<style lang="less">
.waitTitle {
  text-align: center;
  font-size:25px;
  font-weight: bold;
}
.waitCir {
  width:500px;
  height:500px;
  margin:20px auto;
  border-radius: 50%;
  border:10px solid #409eff;
  padding:20px;
  position:relative;
}
.waitCir2 {
  width:452px;
  height:452px;
  border-radius: 50%;
  border:2px dashed #409eff;
  padding:20px;
  animation:myrotate 20s linear infinite;
   -webkit-animation:myrotate 20s linear infinite;
}
.donghua {
  position: absolute;
  top:100px;
  left:200px;
 transform: scale(2);
}
.tongzhi {
  position:absolute;
  top:220px;
  left:0px;
  width:100%;
  text-align: center;
  .tongzhifont{
    margin-bottom:10px;
  font-size:40px;
  font-weight: bold;
  }
  .num {
    color:#fe9d24;
  }
  .waitTime {
    font-size:18px;
    padding-top:20px;
  }
}
@keyframes myrotate{
    form {transform:rotateZ(0deg);}    
    to    {transform:rotateZ(360deg);}
}
@-webkit-keyframes myrotate{/* Safari and Chrome */
    form {transform:rotateZ(0deg);}    
    to    {transform:rotateZ(360deg);}
}
@-webkit-keyframes rotate_pacman_half_up {
  0% {
    -webkit-transform: rotate(270deg);
            transform: rotate(270deg); }

  50% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg); }

  100% {
    -webkit-transform: rotate(270deg);
            transform: rotate(270deg); } }

@keyframes rotate_pacman_half_up {
  0% {
    -webkit-transform: rotate(270deg);
            transform: rotate(270deg); }

  50% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg); }

  100% {
    -webkit-transform: rotate(270deg);
            transform: rotate(270deg); } }

@-webkit-keyframes rotate_pacman_half_down {
  0% {
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg); }

  50% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg); }

  100% {
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg); } }

@keyframes rotate_pacman_half_down {
  0% {
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg); }

  50% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg); }

  100% {
    -webkit-transform: rotate(90deg);
            transform: rotate(90deg); } }

@-webkit-keyframes pacman-balls {
  75% {
    opacity: 0.7; }

  100% {
    -webkit-transform: translate(-100px, -6.25px);
            transform: translate(-100px, -6.25px); } }

@keyframes pacman-balls {
  75% {
    opacity: 0.7; }

  100% {
    -webkit-transform: translate(-100px, -6.25px);
            transform: translate(-100px, -6.25px); } }

.pacman {
  position: relative; }
  .pacman > div:nth-child(2) {
    -webkit-animation: pacman-balls 1s 0s infinite linear;
            animation: pacman-balls 1s 0s infinite linear; }
  .pacman > div:nth-child(3) {
    -webkit-animation: pacman-balls 1s 0.33s infinite linear;
            animation: pacman-balls 1s 0.33s infinite linear; }
  .pacman > div:nth-child(4) {
    -webkit-animation: pacman-balls 1s 0.66s infinite linear;
            animation: pacman-balls 1s 0.66s infinite linear; }
  .pacman > div:nth-child(5) {
    -webkit-animation: pacman-balls 1s 0.99s infinite linear;
            animation: pacman-balls 1s 0.99s infinite linear; }
  .pacman > div:first-of-type {
    width: 0px;
    height: 0px;
    border-right: 25px solid transparent;
    border-top: 25px solid #409eff;
    border-left: 25px solid #409eff;
    border-bottom: 25px solid #409eff;
    border-radius: 25px;
    -webkit-animation: rotate_pacman_half_up 0.5s 0s infinite;
            animation: rotate_pacman_half_up 0.5s 0s infinite; }
  .pacman > div:nth-child(2) {
    width: 0px;
    height: 0px;
    border-right: 25px solid transparent;
    border-top: 25px solid #409eff;
    border-left: 25px solid #409eff;
    border-bottom: 25px solid #409eff;
    border-radius: 25px;
    -webkit-animation: rotate_pacman_half_down 0.5s 0s infinite;
            animation: rotate_pacman_half_down 0.5s 0s infinite;
    margin-top: -50px; }
  .pacman > div:nth-child(3), .pacman > div:nth-child(4), .pacman > div:nth-child(5), .pacman > div:nth-child(6) {
    background-color: #409eff;
    width: 15px;
    height: 15px;
    border-radius: 100%;
    margin: 2px;
    width: 10px;
    height: 10px;
    position: absolute;
    -webkit-transform: translate(0, -6.25px);
        -ms-transform: translate(0, -6.25px);
            transform: translate(0, -6.25px);
    top: 25px;
    left: 100px; }
</style>

